//
//  Auction_SpecialSaleDetailsPrice_Cell_WX.m
//  ZITHER
//
//  Created by weixin on 2019/5/30.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Auction_SpecialSaleDetailsPrice_Cell_WX.h"

@implementation Auction_SpecialSaleDetailsPrice_Cell_WX

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self setUI];
}

- (void)setModel:(specialSaleSceneidDetails *)model{
    _model = model;
    if (model.priceDiscount>0 ) {
        self.PriceLab.text = [NSString stringWithFormat:@"¥%ld",model.priceDiscount];
    }else{
        self.PriceLab.text = @"¥ ？？？";
    }
    
    self.titleLab.text = [NSString stringWithFormat:@"二手行情价 ¥ %ld", model.priceBiz];
    self.numHot.text = [NSString stringWithFormat:@"%ld人出价", model.quoteNum];
}

-(void)setUI{
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.right.equalTo(self).offset(15);

        make.top.equalTo(self.titleSubLab.mas_bottom).offset(10);
        make.right.equalTo(self).offset(-15);
        make.bottom.equalTo(self.mas_bottom).offset(0);
    }];
    
    [self.titleSubLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.top.equalTo(self).offset(20);
        make.height.mas_equalTo(14);
    }];
    
    [self.PriceLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.titleSubLab.mas_right).offset(5);
        make.centerY.equalTo(self.titleSubLab).offset(0);
        make.height.mas_equalTo(20);
    }];
    
    
    [self.numHot mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.iconHot.mas_left).offset(-5);
        make.centerY.equalTo(self.titleSubLab).offset(0);
    }];
    [self.iconHot mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-15);
        make.centerY.equalTo(self.titleSubLab).offset(0);
    }];
    
    
}

-(BaseLab *)titleLab{
    if (!_titleLab) {
        _titleLab = [BaseLab initCustomLab:@"介绍介绍介绍123sdq" color:HexColor(0x666666) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        [self addSubview:_titleLab];
    }
    return _titleLab;
}

-(BaseLab *)titleSubLab{
    if (!_titleSubLab) {
        _titleSubLab = [BaseLab initCustomLab:@"特卖价" color:HexColor(0xff6f6f) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        [self addSubview:_titleSubLab];

    }
    return _titleSubLab;
}

-(BaseLab *)PriceLab{
    if (!_PriceLab) {
        _PriceLab = [BaseLab initCustomLab:@"$123123" color:HexColor(0xff6f6f) font:[UIFont fontWithName:@"PingFangSC-Semibold" size:20]];
        [self addSubview:_PriceLab];

    }
    return _PriceLab;
}


-(BaseLab *)numHot{
    if (!_numHot) {
        _numHot = [BaseLab initCustomLab:@"$40" color:HexColor(0xff6f6f) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:12]];
        [self addSubview:_numHot];
    }
    return _numHot;
}

-(BaseImageV *)iconHot{
    if (!_iconHot) {
        _iconHot= [BaseImageV initCustom:CGRectZero contentMode:2];
        _iconHot.image = [UIImage imageNamed:@"位置图标"];
        _iconHot.backgroundColor = [UIColor grayColor];
        [_iconHot setCornerRadiusWithRadius:30 isMasks:YES];
        [self addSubview:_iconHot];
    }
    return _iconHot;
}

@end
